package com.aaa.demo05;

/**
 * @author ${崔灿}
 * @date 2022/11/01 15:34
 **/

public class TestDaemon {
    public static void main(String[] args) {
        DaemonDemo t1 = new DaemonDemo();
        t1.setDaemon(true); // 设置t1为守护线程 当前线程执行完毕后 守护线程也会介绍
        t1.start();

        DaemonDemo t2 = new DaemonDemo();
        t2.start();
    }
}
class DaemonDemo extends Thread {
    @Override
    public void run() {
        for (int i = 0; i <20;i++) {
            System.out.println(Thread.currentThread().getName()+"****"+i);
        }
    }
}
